//
//  CheckoutPwdViewController.m
//  WBBaseProject
//
//  Created by 吴斌 on 2018/4/12.
//  Copyright © 2018年 吴斌. All rights reserved.
//

#import "CheckoutPwdViewController.h"
#import "XYPasswordView.h"
#import "SetTradPwdViewController.h"
@interface CheckoutPwdViewController ()<XYPasswordViewDelegate>
/** <#注释#> */
@property (nonatomic,strong) XYPasswordView *TXView;
@end

@implementation CheckoutPwdViewController

#pragma mark - 生命周期 Life Circle
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)setupUI
{
    UILabel *tipLb = [[UILabel alloc] initWithFrame:CGRectMake(0, 70, kScreenWidth, 30)];
    tipLb.text = @"修改交易密码";
    tipLb.font = [UIFont systemFontOfSize:18];
    tipLb.textAlignment = NSTextAlignmentCenter;
    tipLb.textColor = WB_HEX_COLOR(0x555555);
    [self.view addSubview:tipLb];
    
    UILabel *detailLb = [[UILabel alloc] initWithFrame:CGRectMake(0, tipLb.mm_bottom + 5, kScreenWidth, 20)];
    detailLb.text = @"请输入交易密码，以验证身份";
    detailLb.textAlignment = NSTextAlignmentCenter;
    detailLb.font = [UIFont systemFontOfSize:12];
    detailLb.textColor = WB_HEX_COLOR(0x999999);
    [self.view addSubview:detailLb];
    
    XYPasswordView *TXView = [[XYPasswordView alloc]initWithFrame:CGRectMake(0, detailLb.mm_bottom + 25,SCREEN_WIDTH, 200)];
    _TXView = TXView;
    TXView.backgroundColor = [UIColor whiteColor];
    TXView.XYPasswordViewDelegate = self;

    [self.view addSubview:TXView];
    
}

#pragma mark  密码输入结束后调用此方法
-(void)XYPasswordView:(XYPasswordView *)view WithPasswordString:(NSString *)Password
{
    NSLog(@"密码 = %@",Password);
    
    SetTradPwdViewController *vc = [[SetTradPwdViewController alloc] init];
    vc.isAddPwd = NO;
    vc.oldPwd = Password;
    [self.navigationController pushViewController:vc animated:YES];
    return;
    [XYHttpRequest dataRequestWithCheckTraderOldPwd:Password success:^(id responseObj) {
        if (Success) {
            SetTradPwdViewController *vc = [[SetTradPwdViewController alloc] init];
            vc.isAddPwd = NO;
            vc.oldPwd = Password;
            [self.navigationController pushViewController:vc animated:YES];
        }else{
            _TXView.isError = YES;
        }
    } failure:^(NSError *error) {
    }];
    
    
    
    //    [self showMessage:[NSString stringWithFormat:@"密码为 : %@",Password] duration:3];

}

@end
